package com.lijinjiang.controller;

import org.junit.*;

/**
 * @ClassName TestAnnotation
 * @Description TODO
 * @Author Li
 * @Date 2022/9/19 14:52
 * @ModifyDate 2022/9/19 14:52
 * @Version 1.0
 */
public class TestAnnotation {
    @Before
    public void testBefore(){
        System.out.println("testBefore执行一次");
    }

    @After
    public void testAfter(){
        System.out.println("testAfter执行一次");
    }

    @BeforeClass
    public static void testBeforeClass(){
        System.out.println("testBeforeClass执行一次");
    }

    @AfterClass
    public static void testAfterClass(){
        System.out.println("testAfterClass执行一次");
    }

    @Test
    public void testLogin() {
        UserService service = new UserService();
        String res = service.login("admin", "123456");

        // 进行预期结果的正确性测试：断言
        Assert.assertEquals("您的登录业务可能出现问题", "登录成功", res);
    }

    @Test
    public void testInsertUser() {
        UserService service = new UserService();
        service.insertUser();
    }
}